package com.fdb.efp.nls.service.impl;

import com.alibaba.fastjson.JSON;
import com.fdb.basic.framework.core.base.FrameworkService;
import com.fdb.efp.nls.service.dao.LoanRepayDetailDao;
import com.fdb.efp.nls.service.domain.LoanRepayDetail;
import com.fdb.efp.nls.service.domain.LoanRepayPlan;
import com.fdb.efp.nls.service.facade.LoanRepayDetailService;
import com.fdb.efp.loan.service.vo.LoanRepayDetailVO;
import org.apache.ibatis.session.RowBounds;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.time.LocalDate;
import java.util.ArrayList;
import java.util.List;
import java.util.Objects;

/**
 * <p>
 * ServiceImpl: 还款明细表
 * <p>
 * 
 * @author cyj
 * @date 2018-12-27
 */
@Service("loanRepayDetailService")
public class LoanRepayDetailServiceImpl implements LoanRepayDetailService, FrameworkService {

	private static Logger logger = LoggerFactory.getLogger(LoanRepayDetailServiceImpl.class);

	@Autowired
	private LoanRepayDetailDao loanRepayDetailDao;

	/**
	 * 同步马上的数据 新增 贷款还款明细
	 * 
	 * @date:2018年12月28日 下午3:33:37
	 * @author:cenyj
	 */
	public boolean batchtLoanRepayDetailFromMaTxt() throws Exception {
		boolean rs = false;
		
		return rs;

	}

	/**
	 * 还款明细新增
	 * 
	 * @description:TODO
	 * @param inLoanRepayDetail
	 * @return
	 * @date:2018年12月28日 下午3:24:47
	 * @author:cenyj
	 */
	public int insertLoanRepayDetail(LoanRepayDetail inLoanRepayDetail) {
		logger.debug("当前新增数据为:" + inLoanRepayDetail.toString());
		int num = 0;
		try {
			num = loanRepayDetailDao.insertLoanRepayDetail(inLoanRepayDetail);
		} catch (Exception e) {
			logger.error("新增数据发生异常!", e);
			num = -1;
		}
		logger.debug("当前新增数据条数为:" + num);
		return num;
	}

	/**
	 * 删除操作
	 */
	public int deleteByPk(LoanRepayDetailVO inLoanRepayDetailVo) {
		logger.debug("当前删除数据条件为:" + inLoanRepayDetailVo);
		int num = 0;
		try {
			LoanRepayDetail loanRepayDetail = new LoanRepayDetail();
			beanCopy(inLoanRepayDetailVo, loanRepayDetail);
			num = loanRepayDetailDao.deleteByPk(loanRepayDetail);
		} catch (Exception e) {
			logger.error("删除数据发生异常!", e);
			num = -1;
		}
		logger.debug("根据条件:" + inLoanRepayDetailVo + "删除的数据条数为" + num);
		return num;
	}

	/**
	 * 更新操作
	 */
	public int updateByPk(LoanRepayDetailVO inLoanRepayDetailVo) {
		logger.debug("当前修改数据为:" + inLoanRepayDetailVo.toString());
		int num = 0;
		try {
			LoanRepayDetail loanRepayDetail = new LoanRepayDetail();
			beanCopy(inLoanRepayDetailVo, loanRepayDetail);
			num = loanRepayDetailDao.updateByPk(loanRepayDetail);
		} catch (Exception e) {
			logger.error("修改数据发生异常!", e);
			num = -1;
		}
		logger.debug("根据条件:" + inLoanRepayDetailVo + "修改的数据条数为" + num);
		return num;
	}

	/**
	 * 查询操作
	 */
	public LoanRepayDetailVO queryByPk(LoanRepayDetailVO inLoanRepayDetailVo) {

		logger.debug("当前查询参数信息为:" + inLoanRepayDetailVo);
		try {
			LoanRepayDetail queryLoanRepayDetail = new LoanRepayDetail();
			beanCopy(inLoanRepayDetailVo, queryLoanRepayDetail);
			LoanRepayDetail queryRslLoanRepayDetail = loanRepayDetailDao.queryByPk(queryLoanRepayDetail);
			if (Objects.nonNull(queryRslLoanRepayDetail)) {
				LoanRepayDetailVO outLoanRepayDetailVo = beanCopy(queryRslLoanRepayDetail, new LoanRepayDetailVO());
				logger.debug("当前查询结果为:" + outLoanRepayDetailVo.toString());
				return outLoanRepayDetailVo;
			} else {
				logger.debug("当前查询结果为空!");
			}
		} catch (Exception e) {
			logger.error("查询数据发生异常!", e);
		}
		return null;
	}

	/**
	 * 查询列表数据
	 */
	@SuppressWarnings("unchecked")
	public List<LoanRepayDetailVO> queryAllOwner(LoanRepayDetailVO loanRepayDetailVo) {

		logger.debug("当前查询参数信息为:"+ loanRepayDetailVo);
		List<LoanRepayDetailVO> list = null;
		try {
			List<LoanRepayDetail> loanRepayDetails = loanRepayDetailDao.queryAllOwnerByPage(loanRepayDetailVo);
			logger.debug("当前查询结果为:" + loanRepayDetails.size());
			// pageSet(loanRepayDetails, loanRepayDetailVo);
			list = (List<LoanRepayDetailVO>) beansCopy(loanRepayDetails, LoanRepayDetailVO.class);
		} catch (Exception e) {
			logger.error("数据转换出现异常!", e);
		}

		return list;

	}

	/**
	 * 查询数据
	 */
	@SuppressWarnings("unchecked")
	public List<LoanRepayDetailVO> queryAllCurrOrg(LoanRepayDetailVO loanRepayDetailVo) {
		logger.debug("当前查询本人所属机构数据信息的参数信息为:");
		List<LoanRepayDetail> loanRepayDetails = loanRepayDetailDao.queryAllCurrOrgByPage(loanRepayDetailVo);
		logger.debug("当前查询本人所属机构数据信息的结果集数量为:" + loanRepayDetails.size());
		List<LoanRepayDetailVO> list = null;
		try {
			// pageSet(loanRepayDetails, loanRepayDetailVo);
			list = (List<LoanRepayDetailVO>) beansCopy(loanRepayDetails, LoanRepayDetailVO.class);
		} catch (Exception e) {
			logger.error("数据转换出现异常!", e);
		}

		return list;

	}

	/**
	 * 查询当前机构及下属机构权限数据
	 */
	@SuppressWarnings("unchecked")
	public List<LoanRepayDetailVO> queryAllCurrDownOrg(LoanRepayDetailVO loanRepayDetailVo) {

		logger.debug("当前查询本人所属机构及以下数据信息的参数信息为:");
		List<LoanRepayDetail> loanRepayDetails = loanRepayDetailDao.queryAllCurrDownOrgByPage(loanRepayDetailVo);
		logger.debug("当前查询本人所属机构及以下数据信息的结果集数量为:" + loanRepayDetails.size());
		List<LoanRepayDetailVO> list = null;
		try {
			// pageSet(loanRepayDetails, loanRepayDetailVo);
			list = (List<LoanRepayDetailVO>) beansCopy(loanRepayDetails, LoanRepayDetailVO.class);
		} catch (Exception e) {
			logger.error("数据转换出现异常!", e);
		}

		return list;

	}

	@Override
	public int insertLoanRepayDetail(LoanRepayDetailVO loanRepayDetailVo) {
		logger.debug("当前新增数据为:" + loanRepayDetailVo.toString());
		int num = 0;
		try {
			LoanRepayDetail loanRepayDetail = new LoanRepayDetail();
			beanCopy(loanRepayDetailVo, loanRepayDetail);
			num = loanRepayDetailDao.insertLoanRepayDetail(loanRepayDetail);
		} catch (Exception e) {
			logger.error("新增数据发生异常!", e);
			num = -1;
		}
		logger.debug("当前新增数据条数为:" + num);
		return num;
	}

	@SuppressWarnings("unchecked")
	@Override
	public List<LoanRepayDetailVO> queryAllByLoanNo(LoanRepayDetailVO loanRepayDetailVO) {
		logger.debug("当前查询以下数据信息的参数信息为:");
		LoanRepayDetail queryLoanRepayDetail = new LoanRepayDetail();	
		beanCopy(loanRepayDetailVO, queryLoanRepayDetail);
		List<LoanRepayDetail> queryLoanRepayDetailList = loanRepayDetailDao.queryAllByLoanNo(queryLoanRepayDetail);
		logger.debug("当前查询本人所属机构及以下数据信息的结果集数量为:" + queryLoanRepayDetailList.size());
		List<LoanRepayDetailVO> list = null;
		try {			
			list = (List<LoanRepayDetailVO>) beansCopy(queryLoanRepayDetailList, LoanRepayDetailVO.class);
		} catch (Exception e) {
			logger.error("数据转换出现异常!", e);
		}

		return list;

	}
	
	@SuppressWarnings("unchecked")
	@Override
	public List<LoanRepayDetailVO> queryAllByLoanNoByPage(LoanRepayDetailVO loanRepayDetailVO) {
		List<LoanRepayDetailVO> list = null;
		logger.debug("根据借据号分页查询还款明细信息开始:");
		LoanRepayDetail queryLoanRepayDetail = new LoanRepayDetail();	
		beanCopy(loanRepayDetailVO, queryLoanRepayDetail);
		List<LoanRepayDetail> queryLoanRepayDetailList = loanRepayDetailDao.queryAllByLoanNoByPage(queryLoanRepayDetail);
		logger.debug("根据借据号查询数据信息的结果集数量为:" + queryLoanRepayDetailList.size());
		try {			
			pageSet(queryLoanRepayDetailList, queryLoanRepayDetail);
			list = (List<LoanRepayDetailVO>) beansCopy(queryLoanRepayDetailList, LoanRepayDetailVO.class);
		} catch (Exception e) {
			logger.error("数据转换出现异常!", e);
		}
		return list;
	}


	@SuppressWarnings("unchecked")
	@Override
	public List<LoanRepayDetailVO> queryLoanRepayDetailByBST(LoanRepayDetailVO param, Integer offse, Integer limt) {

		RowBounds rowBounds = new RowBounds(offse, limt);

		ArrayList<LoanRepayDetailVO> loanRepayDetailVOS = new ArrayList<LoanRepayDetailVO>();
		LoanRepayDetail loanRepayDetail = new LoanRepayDetail();
		beanCopy(param, loanRepayDetail);
		//根据条件查询数据总数
		ArrayList<LoanRepayDetail> loanRepayDetailS =this.loanRepayDetailDao.queryLoanRepayDetailByBST(loanRepayDetail, rowBounds);

		if (loanRepayDetail != null) {
			try {
				loanRepayDetailVOS = (ArrayList<LoanRepayDetailVO>) beansCopy(loanRepayDetailS, LoanRepayDetailVO.class);
			} catch (Exception e) {
				e.printStackTrace();
				logger.error("转换数据发生异常："+e.getMessage());
			}
		}
		return loanRepayDetailVOS;
	}

	@Override
	public Integer queryCountByBST(LoanRepayDetailVO loanRepayDetail) {
		Integer integer = this.loanRepayDetailDao.queryCountByBST(loanRepayDetail);
		System.out.println(integer.intValue());
		return integer;
	}
//
//	@SuppressWarnings("unchecked")
//	@Override
//	public int insertLoanRepDtlBatch(List<LoanRepayDetailVO> LoanRepayDetailList) {
//		logger.debug("当前新增数据条数为:"+ LoanRepayDetailList.size());
//		List<LoanRepayDetail> loanRepayDetailList = new ArrayList<LoanRepayDetail>();
//		int num = 0;
//		try {
//			loanRepayDetailList = (List<LoanRepayDetail>)beansCopy(LoanRepayDetailList, LoanRepayDetail.class);
//			num = loanRepayDetailDao.insertLoanRepDtlBatch(loanRepayDetailList);
//		} catch (Exception e) {
//			logger.error("新增数据发生异常!", e);
//			num = -1;
//		}
//		logger.debug("当前新增数据条数为:"+ num);
//		return num;
//	}

	/**
	 * 
	 * 批量新增还款明细信息 <br>
	 * 0.1:ludayong:2019年3月8日 下午2:37:18:新增 <br>
	 * 
	 * @author ludayong
	 * @since 2019年3月8日 下午2:37:18
	 * @date 2019年3月8日 下午2:37:18
	 * @version 0.1
	 */
	@Override
	public int batchInsertLoanRepayDetail(List<LoanRepayDetailVO> addList) {
		logger.debug("当前新增数据条数为:" + addList.size());
		List<LoanRepayDetail> loanRepayDetailList = new ArrayList<LoanRepayDetail>();
		int num = 0;
		try {
			num = loanRepayDetailDao.batchInsertLoanRepayDetail(loanRepayDetailList);
		} catch (Exception e) {
			logger.error("新增数据发生异常!", e);
			num = -1;
		}
		logger.debug("当前新增数据条数为:" + num);
		return num;
	}

	/**
	 * 
	 * 批量更新还款明细信息 <br>
	 * 0.1:ludayong:2019年3月8日 下午2:37:18:新增 <br>
	 * 
	 * @author ludayong
	 * @since 2019年3月8日 下午2:37:18
	 * @date 2019年3月8日 下午2:37:18
	 * @version 0.1
	 */
	@Override
	public int batchUpdateLoanRepayDetail(List<LoanRepayDetailVO> updateList) {
		logger.debug("当前修改数据为:" + updateList.size() + "条");
		List<LoanRepayDetail> loanRepayDetailList = new ArrayList<LoanRepayDetail>();
		int num = 0;
		try {
			num = loanRepayDetailDao.batchUpdateLoanRepayDetail(loanRepayDetailList);
		} catch (Exception e) {
			logger.error("修改数据发生异常!", e);
			num = -1;
		}
		logger.debug("修改的数据条数为" + num);
		return num;
	}

//	@author:liuty
//	@date:2019/10/17
//	涉及产品:税e贷
//	原因:增量投产只投了接口没投实现，编译报错因此注释，不影响当前产品实际业务
//	@SuppressWarnings("unchecked")
//	@Override
//	public List<LoanRepayDetailVO> queryCreditReportionData(List<String> prdInfoIds, String batchDate) {
//
//		//根据产品查询数据
//		List<LoanRepayDetail> list=loanRepayDetailDao.queryCreditReportingData(prdInfoIds,batchDate);
//		try {
//			return (List<LoanRepayDetailVO>) beansCopy(list, LoanRepayDetailVO.class);
//		} catch (Exception e) {
//			e.printStackTrace();
//		}
//		return null;
//	}
//	

	@Override
	public int countInfoByGlobalSerno(String globalSerno) {
		int result = 0;
		logger.debug("根据全局流水号统计还款数据开始----------全局流水号为："+globalSerno);
		try {
			result = loanRepayDetailDao.countInfoByGlobalSerno(globalSerno);
		} catch (Exception e) {
			logger.error("根据全局流水号统计还款数据出现异常-----全局流水号为："+globalSerno, e);
		}
		return result;
	}
	/**
	 * 贷款每日还款信息临时表数据修改还款明细借据表有数据则更新，无则新增 <br>
	 * 0.1: weijj:2019年5月13日 上午9:08:10:新增 <br>
	 * @author  weijj
	 * @since 2019年5月13日 上午9:08:10
	 * @date 2019年5月13日 上午9:08:10
	 * @version 0.1
	 */
	@SuppressWarnings("unchecked")
	@Override
	public int insertOrUpdateLoanRepayDetail(List<LoanRepayDetailVO> list) {
		// TODO Auto-generated method stub
		LocalDate today = LocalDate.now();
		String msg1 = "【还款明细借据表】数据同步开始..." + today;
		logger.info(msg1, "message{}");
		List<LoanRepayDetail> loanRepayDetailList = new ArrayList<LoanRepayDetail>();
		int num = 0;
		try {
			loanRepayDetailList = (List<LoanRepayDetail>) beansCopy(list, LoanRepayDetail.class);
			num = loanRepayDetailDao.insertOrUpdateLoanRepayDetail(loanRepayDetailList);
			String num_msg = "【还款明细借据表】插入或更新数据处理结果:" + num;
			logger.info(num_msg, "message{}");
		} catch (Exception e) {
			String msg2 = "【还款明细借据表】插入或更新数据出现异常:" + e;
			logger.error(msg2, "message{}");
			num = -1;
		}
		return num;
	}

	@Override
    public int batchInsertOrUpdateLoanRepayPlanDetail(List<LoanRepayDetailVO> LoanRepayDetailVOs) {
		List<LoanRepayPlan> loanRepayPlanDetails = new ArrayList<LoanRepayPlan>();
		int num = 0;
		try {
			loanRepayPlanDetails = (List<LoanRepayPlan>) beansCopy(LoanRepayDetailVOs, LoanRepayDetail.class);
			num = loanRepayDetailDao.insertOrUpdateLoanRepayPlanDetails(loanRepayPlanDetails);
			String num_msg = "【还款计划明细表】插入或更新数据处理结果:" + num;
			logger.info(num_msg, "message{}");
		} catch (Exception e) {
			String msg2 = "【还款计划表明细】插入或更新数据出现异常:" + e;
			logger.error(msg2, "message{}");
			num = -1;
		}
		return num;
    }
//	
//	@author:liuty
//	@date:2019/10/17
//	涉及产品:税e贷
//	功能:根据还款日期模糊查询数据
//	原因:增量投产只投了接口没投实现，编译报错因此注释，不影响当前产品实际业务
//	@Override
//	public List<PlsLoanRepayDetailVO> queryByRepayYear(String repayDay) {
//		// 根据还款日期模糊查询数据
//		List<PlsLoanRepayDetailVO> list = null;
//		try {
//			list = loanRepayDetailDao.queryByRepayYear(repayDay);
//		} catch (Exception e) {
//			e.printStackTrace();
//		}
//		return list;
//	}

	@Override
	public List<LoanRepayDetailVO> queryDataByLoanNos(List<String> loanNos) {
		logger.debug("根据参数查询信息开始，参数为：" + JSON.toJSONString(loanNos));
		try {
			List<LoanRepayDetail> loanRepayDetails = loanRepayDetailDao.queryDataByLoanNos(loanNos);
			if (Objects.nonNull(loanRepayDetails) && !loanRepayDetails.isEmpty()) {
				List<LoanRepayDetailVO> result = (List<LoanRepayDetailVO>) beansCopy(loanRepayDetails, LoanRepayDetailVO.class);
				logger.debug("当前查询结果数量为:" + result.size());
				return result;
			} else {
				logger.info("查询结果为空");
			}
		} catch (Exception e) {
			logger.error("数据转换出现异常!", e);
			e.printStackTrace();
		}
		return null;
	}

    @Override
    public List<LoanRepayDetailVO> queryFailedDataByLoanNos(List<String> loanNos) {
        logger.debug("根据参数查询信息开始，参数为：" + JSON.toJSONString(loanNos));
        try {
            List<LoanRepayDetail> loanRepayDetails = loanRepayDetailDao.queryFailedDataByLoanNos(loanNos);
            if (Objects.nonNull(loanRepayDetails) && !loanRepayDetails.isEmpty()) {
                List<LoanRepayDetailVO> result = (List<LoanRepayDetailVO>) beansCopy(loanRepayDetails, LoanRepayDetailVO.class);
                logger.debug("当前查询结果数量为:" + result.size());
                return result;
            } else {
                logger.info("查询结果为空");
            }
        } catch (Exception e) {
            logger.error("数据转换出现异常!", e);
            e.printStackTrace();
        }
        return null;
    }

	@Override
	public List<LoanRepayDetailVO> querySuccessRepayDetail() {
		logger.debug("查询已经成功的还款开始:");
		List<LoanRepayDetailVO> loanRepayDetailList = new ArrayList<LoanRepayDetailVO>();
		try {
			ArrayList<LoanRepayDetail> loanRepayDetails = loanRepayDetailDao.querySuccessRepayDetail();
			loanRepayDetailList = (ArrayList<LoanRepayDetailVO>) beansCopy(loanRepayDetails, LoanRepayDetailVO.class);
		} catch (Exception e) {
			logger.error("查询已经成功的还款记录发生异常", e);
		}
		logger.debug("查询已经成功的还款结束");
		return loanRepayDetailList;
	}



	@Override
	public List<LoanRepayDetailVO> queryByRpyNo(List<String> list) throws Exception {
		if (list == null) {
			return null;
		}
		if (list.isEmpty()) {
			return null;
		}
		return (List<LoanRepayDetailVO>) beansCopy(this.loanRepayDetailDao.queryByRpyNo(list), LoanRepayDetailVO.class);

	}


	/**
	 *需求编号：【2020D0311】（马上还款明细同步）
	 *问题编号：【2020D0311】（根据还款流水号，贷款借据号，还款期数查询还款明细信息）
	 *开发人员：【ludayong】
	 *创建日期：【2020/2/26 15:19】
	 *功能描述：
	 *修改日期：【2020/2/26 15:19】
	 *修改描述：
	 */
	public LoanRepayDetailVO queryLoanRepayDetailByCondition(LoanRepayDetailVO inLoanRepayDetailVo) {
		logger.debug("当前查询参数信息为:" + inLoanRepayDetailVo);
		try {
			LoanRepayDetail queryLoanRepayDetail = new LoanRepayDetail();
			beanCopy(inLoanRepayDetailVo, queryLoanRepayDetail);
			LoanRepayDetail queryRslLoanRepayDetail = loanRepayDetailDao.queryLoanRepayDetailByCondition(queryLoanRepayDetail);
			if (Objects.nonNull(queryRslLoanRepayDetail)) {
				LoanRepayDetailVO outLoanRepayDetailVo = beanCopy(queryRslLoanRepayDetail, new LoanRepayDetailVO());
				logger.debug("当前查询结果为:" + outLoanRepayDetailVo.toString());
				return outLoanRepayDetailVo;
			} else {
				logger.debug("当前查询结果为空!");
			}
		} catch (Exception e) {
			logger.error("查询数据发生异常!", e);
		}
		return null;
	}

	/**
	 *需求编号：【2020D0311】（马上还款明细同步）
	 *问题编号：【2020D0311】（根据还款流水号，贷款借据号，还款期数更新还款明细信息）
	 *开发人员：【ludayong】
	 *创建日期：【2020/2/26 15:19】
	 *功能描述：
	 *修改日期：【2020/2/26 15:19】
	 *修改描述：
	 */
	public int updateLoanRepayDetailByCondition(LoanRepayDetailVO inLoanRepayDetailVo) {
		logger.debug("当前修改数据为:" + inLoanRepayDetailVo.toString());
		int num = 0;
		try {
			LoanRepayDetail loanRepayDetail = new LoanRepayDetail();
			beanCopy(inLoanRepayDetailVo, loanRepayDetail);
			num = loanRepayDetailDao.updateLoanRepayDetailByCondition(loanRepayDetail);
		} catch (Exception e) {
			logger.error("修改数据发生异常!", e);
			num = -1;
		}
		logger.debug("根据条件:" + inLoanRepayDetailVo + "修改的数据条数为" + num);
		return num;
	}

	public List<LoanRepayDetailVO> queryByWfStsAndRsSts(){
		logger.debug("当前查询参数信息为:");
		try {
			LoanRepayDetail queryLoanRepayDetail = new LoanRepayDetail();
			List<LoanRepayDetail> queryRs = loanRepayDetailDao.queryByWfStsAndRsSts();
			if (Objects.nonNull(queryRs) && !queryRs.isEmpty()) {
				List<LoanRepayDetailVO> loanRepayDetailList = (ArrayList<LoanRepayDetailVO>) beansCopy(queryRs, LoanRepayDetailVO.class);
				logger.debug("当前查询结果为:" + loanRepayDetailList.toString());
				return loanRepayDetailList;
			} else {
				logger.debug("当前查询结果为空!");
			}
		} catch (Exception e) {
			logger.error("查询数据发生异常!", e);
		}
		return null;
	}

	@Override
	public int insertOrUpdatePsd(List<LoanRepayDetailVO> list) throws Exception {
		return this.loanRepayDetailDao.insertOrUpdatePsd((List<LoanRepayDetail>) beansCopy(list, LoanRepayDetail.class));
	}

	@Override
	public List<LoanRepayDetailVO> queryBySetlSeq(String setlSeq) throws Exception {

		return (List<LoanRepayDetailVO>) beansCopy(loanRepayDetailDao.queryBySetlSeq(setlSeq), LoanRepayDetailVO.class);

	}

    @Override
    public List<LoanRepayDetailVO> queryDetailBySetlApplyDt(LoanRepayDetailVO loanRepayDetailVo){
        logger.info("查询数据参数信息" + loanRepayDetailVo.getLoanNo());
        try {
            LoanRepayDetail loanRepayDetail = new LoanRepayDetail();
            beanCopy(loanRepayDetailVo,loanRepayDetail);
            List<LoanRepayDetail> queryRs = loanRepayDetailDao.queryDetailBySetlApplyDt(loanRepayDetail);
            if (Objects.nonNull(queryRs) && !queryRs.isEmpty()) {
                List<LoanRepayDetailVO> loanRepayDetailList = (ArrayList<LoanRepayDetailVO>) beansCopy(queryRs, LoanRepayDetailVO.class);
                logger.debug("当前查询结果为:" + loanRepayDetailList.toString());
                return loanRepayDetailList;
            } else {
                logger.debug("当前查询结果为空!");
            }
        } catch (Exception e) {
            logger.error("查询数据发生异常!", e);
        }
        return null;
    }

	@Override
	public List<LoanRepayDetailVO> queryDetailBySetlTyo(LoanRepayDetailVO loanRepayDetailVo){
		logger.info("查询数据参数信息" + loanRepayDetailVo.getLoanNo());
		try {
			LoanRepayDetail loanRepayDetail = new LoanRepayDetail();
			beanCopy(loanRepayDetailVo,loanRepayDetail);
			List<LoanRepayDetail> queryRs = loanRepayDetailDao.queryDetailBySetlTyo(loanRepayDetail);
			if (Objects.nonNull(queryRs) && !queryRs.isEmpty()) {
				List<LoanRepayDetailVO> loanRepayDetailList = (ArrayList<LoanRepayDetailVO>) beansCopy(queryRs, LoanRepayDetailVO.class);
				logger.debug("当前查询结果为:" + loanRepayDetailList.toString());
				return loanRepayDetailList;
			} else {
				logger.debug("当前查询结果为空!");
			}
		} catch (Exception e) {
			logger.error("查询数据发生异常!", e);
		}
		return null;
	}
}
